<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">

<head>
    <title></title>
    <meta charset="utf-8">
    <link href="/css/SaveAndSearch/style.css" rel="stylesheet" type="text/css"/>
    <!--pageoffice.js一定要引用  -->
    <script type="text/javascript" src="/pageoffice.js"></script>
    <script type="text/javascript">
        function editWord(id){
            POBrowser.openWindow('/SaveAndSearch/Word?id='+id, 'width=1200px;height=800px;',encodeURI(document
                .getElementById("Input_KeyWord").value));
        }
        //控件中的一些常用方法都在这里调用，比如保存，打印等等
        function onColor(td) {
            td.style.backgroundColor = '#87ffc7';
        }

        function offColor(td) {
            td.style.backgroundColor = '';
        }

        function getFocus() {
            var str = document.getElementById("Input_KeyWord").value;
            if (str == "请输入关键字") {
                document.getElementById("Input_KeyWord").value = "";
            }

        }

        function lostFocus() {
            var str = document.getElementById("Input_KeyWord").value;
            if (str.length <= 0) {
                document.getElementById("Input_KeyWord").value = "请输入关键字";
            }
        }

        function copyKeyToInput(key) {
            document.getElementById("Input_KeyWord").value = key;
        }

        function mySubmit() {
            document.getElementById("form1").submit();

        }
    </script>

</head>
<body>
<div class="zz-content mc clearfix pd-28" align="center">

    <div class="demo mc">
        <h2 class="fs-16">PageOffice 实现Word文档的在线编辑保存和全文关键字搜索</h2>
    </div>

    <div class="demo mc">
        <h3 class="fs-12">搜索文件</h3>
        <!-- <form id="form1" action="index" method="get"> -->
        <form form id="form1" action="/SaveAndSearch/index" method="get">
            <table class="text" cellspacing="0" cellpadding="0" border="0">
                <tr>
                    <td style="font-size: 9pt" align="left">
                        通过文档内容中的关键字搜索文档&nbsp;&nbsp;&nbsp;
                    </td>
                    <td align="center">
                        <input name="Input_KeyWord" id="Input_KeyWord" type="text" onfocus="getFocus()"
                               onblur="lostFocus()"
                               class="boder" style="width: 180px;" th:value="${Input_KeyWord}"/>
                    </td>
                    <td style="width: 221px;">
                        &nbsp;
                        <input type="button" value="搜索" onclick="mySubmit();" style=" width:86px;"/>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td colspan="2">&nbsp;<span style="color:Gray;">热门搜索：</span>
                        <a href="#" style="color:#00217d;" onclick="copyKeyToInput('网站');">网站</a>
                        <a href="#" style="color:#00217d;" onclick="copyKeyToInput('软件');">软件</a>
                        <a href="#" style="color:#00217d;" onclick="copyKeyToInput('字体');">字体</a></td>
                </tr>
            </table>
        </form>
    </div>

    <div class="zz-talbeBox mc">
        <h3 class="fs-12">文档列表</h3>

        <table class="zz-talbe">
            <thead>
            <tr>
                <th width="90%">文档名称</th>
                <th width="10%">操作</th>
            </tr>
            </thead>

            <tbody>
            <tr th:each="docSearch : ${docSearchs}">
                <td th:text="${docSearch.fileName}">fileName</td>
                <td >
                    <input type="button" th:onclick="|editWord(${docSearch.id})|" value="编辑"/>
                </td>



            </tr>
            </tbody>

        </table>

    </div>

</div>

</body>
</html>
